import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 获取基础档案-数据字典列表 */
export const getDictionary = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/dictionary/page"), {
    params: filerEmptyVal(params)
  });
};

/** 基础档案--数据字典列表-数据字典 */
export const dictionaryAdd = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/dictionary/add"), { data });
};

/** 基础档案-数据字典列表-编辑数据字典 */
export const dictionaryUpdate = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/dictionary/update"), { data });
};

/** 基础档案-数据字典列表-删除数据字典 */
export const dictionaryDelete = (id?: object) => {
  return http.request<any>("post", baseUrlApi(`/dictionary/delete?id=${id}`));
};
